package cn.com.bluemoon.daps.domp.api;

import cn.com.bluemoon.daps.common.constant.ServiceNameConstants;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value= ServiceNameConstants.DapsApiDomp.MAIL_SERVICE)
@RequestMapping(value = "/mail")
@Api(tags = "FeignClient服务-邮箱发送服务" + ServiceNameConstants.DapsApiDomp.MAIL_SERVICE)
public interface MailService {
	/**
	 * receiver 接收人
	 * topic 主题
	 * msg 邮件内容
	 * @return 是否发送成功，true成功，false失败
	 */
	// boolean sendMail(String receiver,String topic,String msg) ;
	@RequestMapping(value = "/sendSimpleMail")
	public void sendSimpleMail(@RequestParam("sendTo") String sendTo, @RequestParam("title") String title, @RequestParam("content") String content);

	/**
	 * rcs 接收人列表，可多人
	 * ccs 抄送人列表，可多人，可为空
	 * bcc 密送人列表，可为空
	 * topic 主题，可为空
	 * msg 普通文本邮件内容
	 * attachmentMap key文件名，value附件URL，可为空
	 * @return 是否发送成功，true成功，false失败
	 */
	// boolean sendMailAtt(String[] rcs, String[] ccs ,String[] bccs, String topic, String msg, Map<String,String>  attachmentMap);
	@RequestMapping(value = "/sendMailAtt")
	public boolean sendMailAtt(@RequestParam("rcs") String[] rcs, @RequestParam("ccs") String[] ccs,
                               @RequestParam("bccs") String[] bccs, @RequestParam("topic") String topic, @RequestParam("msg") String msg,
                               @RequestParam("attachmentMap") Map<String, String> attachmentMap);


	/**
	 * rcs 接收人列表，可多人
	 * ccs 抄送人列表，可多人，可为空
	 * bcc 密送人列表，可为空
	 * topic 主题，可为空
	 * msg html邮件内容
	 * attachmentMap key文件名，value附件URL，可为空（Collections.emptyMap()）而不是null
	 * @return 是否发送成功，true成功，false失败
	 */
	@RequestMapping(value = "/sendHtmlMailAtt")
	boolean sendHtmlMailAtt(@RequestParam("rcs") String[] rcs, @RequestParam("ccs") String[] ccs,
                            @RequestParam("bccs") String[] bccs, @RequestParam("topic") String topic, @RequestParam("msg") String msg,
                            @RequestParam("attachmentMap") Map<String, String> attachmentMap);
 }
